<?php

// header("Access-Control-Allow-Origin:*");

// 获取 请求来源
$origin = $_SERVER["HTTP_ORIGIN"];
header("Access-Control-Allow-Origin:$origin");


header( 'Content-Type:application/json;charset=utf-8' );
$user = [
    "name"=>"tom",
    "age"=>22
];
// 返回json
echo json_encode($user);
?>